package cn.zahou.SJR;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

@SuppressWarnings("ALL")
public class MySQL_poolTesting {
    public static void main(String[] args) throws SQLException {

        //    创建数据库连接池
//        DataSource ds=new ComboPooledDataSource("otherc3p0");
 DataSource ds=new ComboPooledDataSource();

//    2.获取连接对象
//        Connection connection=ds.getConnection();
        for (int i = 1; i <=10; i++) {
            Connection connection=ds.getConnection();
            System.out.println(i+":"+connection);

        }
//        System.out.println(connection);
    }

}
